<%@ page language="java" contentType="application/octet-stream;charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.service.*" %>
<%
	out.clear();
	out = pageContext.pushBody(); 
	
	
	String excelTitle = "복지자원목록";
	
	response.setHeader("Content-Disposition","attachment;filename="+java.net.URLEncoder.encode(excelTitle, "utf-8")+"_"+StringUtil.today()+".xls");
	response.setHeader("Content-Description","JSP Generated Data");
	
	
	
	String sort_col				= StringUtil.nvl(request.getParameter("sort_col"), "to_number(service_id)");
	String sort_asc				= StringUtil.nvl(request.getParameter("sort_asc"), "asc");
	
	String srch_age				= StringUtil.nvl(request.getParameter("srch_age"));
	String srch_target			= StringUtil.nvl(request.getParameter("srch_target"));
	String srch_family			= StringUtil.nvl(request.getParameter("srch_family"));
	String srch_income			= StringUtil.nvl(request.getParameter("srch_income"));
	String srch_support			= StringUtil.nvl(request.getParameter("srch_support"));
	String srch_needs			= StringUtil.nvl(request.getParameter("srch_needs"));
	String service_name			= StringUtil.nvl(request.getParameter("service_name"));
	
	HashMap infos = new HashMap();
	infos.put("use_yn", 		"Y");
	infos.put("sort_col", 		sort_col);
	infos.put("sort_asc", 		sort_asc);
	infos.put("srch_age", 		srch_age);
	infos.put("srch_target", 	srch_target);
	infos.put("srch_family", 	srch_family);
	infos.put("srch_income", 	srch_income);
	infos.put("srch_support", 	srch_support);
	infos.put("srch_needs", 	srch_needs);
	infos.put("service_name", 	service_name);
	


	ServiceDAO dao 	= new ServiceDAO();
	HashList list 	= dao.selectServiceList(infos);

	list.setHeader("service_gubn", 	"사업구분",	MetaData.ALIGN_LEFT);
	list.setHeader("service_name", 	"서비스명",	MetaData.ALIGN_LEFT);
	list.setHeader("dept_name", 	"담당부서",	MetaData.ALIGN_LEFT);
	list.setHeader("tel_no", 		"연락처",	MetaData.ALIGN_LEFT);
	list.setHeader("mod_date", 		"최종수정일",	MetaData.ALIGN_CENTER);
	list.setHeader("hit_count", 	"조회수",	MetaData.ALIGN_RIGHT);
	
	list.writeToExcel(response, excelTitle);
%>
						
